import request from '@/utils/request'
import {getTokenLocalStorage, getUserIDLocalStorage} from "@/utils/utilLocalStorage";

/**
 * @description: 获取学生个人信息
 * @return {*} promise
 * @param studentId
 */
export function getInfoAPI_Student(studentId) {
  return request({
    url: '/students/' + studentId,
    method: 'GET',
    // headers: {
    //   // 如如果 API 使用的是 Bearer 认证：'Bearer ' + ''
    //   'Authorization': 'Bearer' + getTokenLocalStorage(),
    //   // 如果需要，还可以添加其他头部信息
    //   // 'Content-Type': 'application/json',
    // },
  })
}

/**
 * @description: 修改学生个人信息
 * @return {*} promise
 * @param data
 */
export function modifyAPI_Student(data) {
  return request({
    url: '/students/' + getUserIDLocalStorage(),
    method: 'PUT',
    data
  })
}
export function getSAPI_Student() {
  return request({
    url: '/gradeRecords/getByCourseId/' + 0,
    method: 'GET',

  })
}
// 学生用户注销
// /students/{studentId}
export function deleteStudentAPI(studentId) {
  return request({
    url: '/students/' + studentId,
    method: 'DELETE',
  })
}